<?php
/**
 * Created by PhpStorm.
 * User: 68008000
 * Date: 2017/12/5
 * Time: 0:27
 */

namespace app\common\model;


use think\Model;

class lists extends Model
{
    //连接数据库
    protected $table= 'shop_order';
    protected $pk= 'oid';
    public function add($data){
        p($data);
        $res = $this->validate(true)->save($data,['oid' => $data['oid']]);
        if(false === $res){
            // 验证失败 输出错误信息
            return ['valid'=>0,'msg'=>'修改失败'];
        }else{

            return ['valid'=>1,'msg'=>'修改成功'];
        }
    }
}